import { Toast, Dialog } from "vant"
import level1 from "@/assets/image/account/tao_level1.png";
import level2 from "@/assets/image/account/tao_level2.png";
import level3 from "@/assets/image/account/tao_level3.png";
import level4 from "@/assets/image/account/tao_level4.png";
import level5 from "@/assets/image/account/tao_level5.png";
import level6 from "@/assets/image/account/tao_level6.png";
import level7 from "@/assets/image/account/tao_level7.png";
import level8 from "@/assets/image/account/tao_level8.png";
import level9 from "@/assets/image/account/tao_level9.png";
import level10 from "@/assets/image/account/tao_level10.png";
import level11 from "@/assets/image/account/tao_level11.png";
import level12 from "@/assets/image/account/tao_level12.png";
import level13 from "@/assets/image/account/tao_level13.png";
import level14 from "@/assets/image/account/tao_level14.png";
import level15 from "@/assets/image/account/tao_level15.png";
import tb_icon from "@/assets/image/good/tb_icon.png";
import tm_icon from "@/assets/image/good/tm_icon.png";
import jd_icon from "@/assets/image/good/jd_icon.png";
import pdd_icon from "@/assets/image/good/pdd_icon.png";
import al_icon from "@/assets/image/good/al_icon.png";
import dou_icon from "@/assets/image/good/dou_icon.png";
import kuai_icon from "@/assets/image/good/kuai_icon.png";
import taobaotj_icon from "@/assets/image/good/taobaotj_icon.png";
import Clipboard from "clipboard";

export const copy = (el: string) => {
  let clipboard = new Clipboard(el);
  clipboard.on("success", (e) => {
    fnMsg("复制成功");
    // 释放内存
    clipboard.destroy();
  });
  clipboard.on("error", (e) => {
    // 不支持复制
    fnMsg("该浏览器不支持自动复制");
    // 释放内存
    clipboard.destroy();
  });
};

export const fnMsg = (msg: string) => {
    Toast(
        {
            message: msg,
            position: 'bottom',
          }
    );
};

export const fnDialog = (title: string, content: string):Promise<any> => {
    return Dialog.confirm({
        title: title,
        message:content,
      })
}

export const icons = [
  tb_icon,
  tm_icon,
  jd_icon,
  pdd_icon,
  al_icon,
  dou_icon,
  kuai_icon,
  taobaotj_icon,
];

export const  consumeList = [
  "10-50元",
  "51-150元",
  "151-250元",
  "351-500元",
  "500元以上",
]

export const  labelList = [
  "在校学生",
  "职场白领",
  "技术蓝领",
  "家庭主妇",
  "专职司机",
  "公务员",
  "医护人员",
  "餐饮娱乐",
  "自由职业",
]

export const levels = [
  level1,
  level2,
  level3,
  level4,
  level5,
  level6,
  level7,
  level8,
  level9,
  level10,
  level11,
  level12,
  level13,
  level14,
  level15,
];